import request from '../utils/request';//导入帮助类里面的request对象，帮助我们发送请求给后端api接口
//权限列表显示
export const PermissionTree = query => {
    return request({
        url: '/api/Permission',
        method: 'get',//get请求用params
    });
};
//权限添加
export const PermissionAdd = query => {
    return request({
        url: '/api/Permission',
        method: 'post',//post请求用data
        data:query,
    });
};

//刷新Token
export const fetchData = query => {
    return request({
        url: '/api/Jwt/JwtToken',
        method: 'get',//get请求用data
        params: query
    });
};

//权限删除
export const PermissionDelete = query => {
    return request({
        url: '/api/Permission?id='+query,
        method: 'delete'
    });
};

//权限的编辑
export const updatePermission = query => {
    return request({
        url: '/api/Permission',
        method: 'put',
        data:query
    });
};

//根据主键查询权限
export const getPermission = query => {
    return request({
        url: '/api/Permission/id?id='+query,
        method: 'get'
    });
};